home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / windows / pmcstex.zip / PM_ERX.ZIP / SAMPACTN.E < prev    next >
Text File  |  1996-05-23  |  20KB  |  429 lines

  1. ; This is a Toolbar Actions file.  You add a line to your ACTIONS.LST:
  2. ;    sampactn
  3. ; to indicate that this should be invoked to build the list of defined
  4. ; actions when the user asks for a list (by selecting Create or Edit
  5. ; from the toolbar pop-up menu and clicking on the drop-down arrow
  6. ; on the Actions page).  EPM loads this .ex file and executes the
  7. ; command SAMPACTN_ACTIONLIST (it appends "_ACTIONLIST" to the name of the
  8. ; .ex file).  This command must be defined by the actions file to add
  9. ; a line to a file for each toolbar-definable action defined in the .ex
  10. ; file.
  11.  
  12. ; The line consists of the command to be executed, a description of the
  13. ; action, and the name of the .ex file, each separated by a delimiter
  14. ; (which is the first character on the line, and can be any character
  15. ; otherwise unused on that line; below, an ASCII 1 is used throughout).
  16. ; The description is used in the action page description field when
  17. ; you edit or create an item of the toolbar. It should explain both what
  18. ; the action does, and which parameters it expects.
  19. ; No space is wasted because the descriptions below
  20. ; are constants which are also used as button selection prompts.
  21.  
  22. ; The action commands (below, "a_messages", etc.) may be called with a
  23. ; parameter of "I" to indicate that the menu has been initialized (the user
  24. ; pressed MB1 down over this toolbar item, or pressed MB1 down over another
  25. ; toolbar item and dragged the mouse over this item, or pressed F10 to go to
  26. ; the action bar and scrolled to this toolbar item), "E" for a menu-end message,
  27. ; "H" for Help (user pressed F1), or "S" to indicate that the toolbar item
  28. ; has been selected.  The parameter might be followed by command parameters
  29. ; if the user entered any in the Parameters field of the Actions page.
  30.  
  31. ; Now, the executable portions of the file.  First, include some files to
  32. ; define constants that will be needed in this file (yours might not need them):
  33.  
  34. const
  35.    WANT_DYNAMIC_PROMPTS = 1  -- Force definition of menu prompts in ENGLISH.E.
  36. include 'stdconst.e'
  37. include 'english.e'
  38. include 'menuhelp.h'
  39.  
  40. ; Next, define some additional text constants (defined as separate constants
  41. ; instead of using the strings where needed in order to allow for easier NLS
  42. ; translation).
  43.  
  44. const
  45. ;  a_Messages_PROMPT = MESSAGES_MENUP__MSG  -- Defined in ENGLISH.E.  Starts with ASCII 1
  46.    a_Add_New__MSG = 'Add New'
  47.    a_Add_New_PROMPT = 'Add a new, .Untitled file to the ring'
  48.    a_Open_empty_PROMPT = \1'Open a new edit window containing .Untitled'
  49.    a_NewWindow_PROMPT = \1'Move current file to new edit window (saving changes, if any)'
  50. ;  a_Settings_PROMPT = CONFIG_MENUP__MSG
  51.    a_Time_PROMPT = \1'Display or type the time'
  52.    a_Time_PROMPT2= '.  Parameter = "?" to display, or "I" to insert into file.'
  53.    a_Date_PROMPT = \1'Display or type the date'
  54.    a_Date_PROMPT2= '.  Parameter = "?" to display, or "USA", "European", "Ordered" or "Normal" to insert into file.'
  55.    a_MonoFont_PROMPT = 'Change to a monospaced font, or back to the default font'
  56. ;  a_Shell_PROMPT = CREATE_SHELL_MENUP__MSG
  57.    a_Shell_PROMPT2 = '.  Optional parameter is command to be written to new shell window.'
  58. ;  a_List_Ring_PROMPT = LIST_FILES_MENUP__MSG
  59.    a_Toggle_Hilight__MSG = 'Keyword highlighting'
  60.    a_Toggle_Hilight_PROMPT = 'Toggle keyword highlighting on or off'
  61.    a_Print__MSG = 'Print'
  62.    a_Match_Brackets_PROMPT = 'Move cursor to matching bracket, #if / #endif, :ol / :eol, /* */, or SGML tag.'
  63.    a_Match_Brackets_PROMPT2 = '(bracket is one of ()[]{}<> )'
  64.    Generic_toolbar_help_title = 'Help for Toolbar selection'
  65.    EXECUTES_COMMAND = 'Executes command:'
  66.    NO_HILIGHT_KNOWN__MSG = "Don't know what keyword highlighting file to use."
  67.    a_Timestamp_PROMPT = \1'Type a timestamp into the file'
  68.  
  69. EA_comment 'This is a toolbar "actions" file which defines a number of simple commands.'
  70.  
  71. ----------------------- End of MRI for translation ---------------------------------
  72.  
  73. ; Here is the <file_name>_ACTIONLIST command that adds the action commands
  74. ; to the list.
  75.  
  76. defc sampactn_actionlist
  77.    universal ActionsList_FileID  -- This is the fileid that gets the line(s)
  78.  
  79.    insertline "a_Messages"MESSAGES_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  80.    insertline "a_Add_New"a_Add_New_PROMPT"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  81.    insertline "a_Add_File"ADD_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  82.    insertline "a_Open_empty"a_Open_empty_PROMPT"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  83.    insertline "a_NewWindow"a_NewWindow_PROMPT"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  84.    insertline "a_Settings"CONFIG_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  85.    insertline "a_Time"a_Time_PROMPT||a_Time_PROMPT2"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  86.    insertline "a_Date"a_Date_PROMPT||a_Date_PROMPT2"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  87.    insertline "a_TimeStamp"a_Timestamp_PROMPT"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  88.    insertline "a_MonoFont"a_MonoFont_PROMPT"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  89.    insertline "a_Shell"CREATE_SHELL_MENUP__MSG || a_Shell_PROMPT2"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  90.    insertline "a_List_Ring"LIST_FILES_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  91.    insertline "a_Compiler_Help"DESCRIBE_COMPILER_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  92.    insertline "a_Compiler_Next"NEXT_COMPILER_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  93.    insertline "a_Compiler_Prev"PREV_COMPILER_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  94.    insertline "a_Proof"PROOF_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  95.    insertline "a_Synonym"SYNONYM_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  96.    insertline "a_Togl_Hilit"a_Toggle_Hilight_PROMPT"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  97.    insertline "a_Print"ENHPRT_FILE_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  98.    insertline "a_Save"SAVE_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  99.    insertline "a_SearchDlg"SEARCH_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  100.    insertline "a_UndoDlg"UNDO_REDO_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  101.    insertline "a_Quit"QUIT_MENUP__MSG"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  102.    insertline "a_match_brackets"a_MATCH_BRACKETS_PROMPT a_MATCH_BRACKETS_PROMPT2"sampactn", ActionsList_FileID.last+1, ActionsList_FileID
  103.  
  104. ; These are the command that will be called for the above actions.  Since all
  105. ; actions defined herein resolve to standard commands, the Help doesn't need
  106. ; to load an additional help file; it can refer to panels in the standard
  107. ; EPM.HLP.
  108.  
  109. defc a_Messages
  110.    a_common_action(arg(1), 'messagebox', MESSAGES_MENUP__MSG, HP_OPTIONS_MESSAGES)
  111.  
  112. defc a_Add_New
  113.    parse arg action_letter parms
  114.    if action_letter = 'I' then       -- button Initialized
  115.       display -8
  116.       sayerror a_Add_New_PROMPT
  117.       display 8
  118.    elseif action_letter = 'S' then   -- button Selected
  119.       sayerror 0                        -- Clear prompt
  120.       'xcom e /n'                       -- execute action
  121.    elseif action_letter = 'H' then   -- button Help
  122. ;;    'helpmenu' ???                     -- No help panel for this; use a messagebox
  123.       call winmessagebox(a_Add_New__MSG, a_Add_New_PROMPT, MB_OK + MB_INFORMATION + MB_MOVEABLE)
  124.    elseif action_letter = 'E' then   -- button End
  125. ;;    sayerror 0                        -- (We don't do anything for this one; get lots of them.)
  126.    endif
  127.  
  128. defc a_Add_File
  129.    a_common_action(arg(1), 'opendlg EDIT', ADD_MENUP__MSG, HP_FILE_EDIT)
  130.  
  131. defc a_Open_empty
  132.    a_common_action(arg(1), 'open', a_Open_empty_PROMPT, HP_FILE_OPEN_NEW)
  133.  
  134. defc a_NewWindow
  135.    a_common_action(arg(1